// pages/collect/index.js
Page({
  data:{
    tabs:[{
      id:0,
      name:'商品收藏',
      isActive:true
    },
    {
      id:1,
      name:'品牌收藏',
      isActive:false
    },
    {
      id:2,
      name:'店铺收藏',
      isActive:false
    },
    {
      id:3,
      name:'浏览足迹',
      isActive:false
    }],
    collect:[]
  },
  onShow(){
    let collect = wx.getStorageSync('collect');
    this.setData({
      collect
    })
  },
    //tab栏点击事件
    itemChange(e){
      //console.log(e);
      const {index} = e.detail;
      const list = this.data.tabs;
      list.forEach((v,i)=>i===index?v.isActive=true:v.isActive=false);
      this.setData({
        tabs:list
      })
    },
})